<script setup>
import { useRouter } from "vue-router";
import MyHeader from "@/components/MyHeader.vue";
const route = useRouter();
function goToActiviti() {
  route.push("/activiti/process");
}
function goToPinia() {
  route.push("/piniaPage");
}
function goToCommunication() {
  route.push("/communication");
}
</script>

<template>
  <div class="common-layout">
    <el-container>
      <el-header>
        <MyHeader />
      </el-header>
      <el-main class="main-content">
        <router-view></router-view>
      </el-main>
      <el-footer>
        <el-button type="primary" @click="goToActiviti"
          >去到activiti页面</el-button
        >
        <el-button type="primary" @click="goToPinia">去到pinia页面</el-button>
        <el-button type="primary" @click="goToCommunication"
          >去到组件通信页面</el-button
        >
      </el-footer>
    </el-container>
  </div>
</template>

<style scoped>
.el-header {
  height: auto;
  /* 让 header 高度根据内容自动调整 */
  padding: 0;
  /* 移除默认的 padding */
}

.main-content {
  padding: 20px;
  border: 1px solid #ccc;
  height: 400px;
}
</style>
